# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=kdelibs4support
pkgver=5.50.0
pkgrel=1
pkgdesc='Porting aid from KDELibs4'
arch=(x86_64)
url='https://community.kde.org/Frameworks'
license=(LGPL)
depends=(kunitconversion kitemmodels kemoticons kded kparts)
makedepends=(extra-cmake-modules kdoctools qt5-tools networkmanager perl-uri kdesignerplugin)
groups=(kf5-aids)
source=("https://download.kde.org/stable/frameworks/${pkgver%.*}/portingAids/$pkgname-$pkgver.tar.xz"{,.sig})
sha256sums=('b4800719c22fbb6643ea17c83eb01fe4468604c19c5bfd89430dba6b59b8348a'
            'SKIP')
validpgpkeys=(53E6B47B45CEA3E0D5B7457758D0EE648A48B3BB) # David Faure <faure@kde.org>

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DBUILD_TESTING=OFF
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install

# cert bundle seems to be hardcoded
# link it to the one from ca-certificates
  rm -f "$pkgdir"/usr/share/kf5/kssl/ca-bundle.crt
  ln -sf /etc/ssl/certs/ca-certificates.crt "$pkgdir"/usr/share/kf5/kssl/ca-bundle.crt
}
